# import re
# f = open("disease.txt", "r")
# print(set(re.split('\n', f.read())))
# f.close()

# data = {'a', 'b', 'c'}
# with open("disease.txt", "w") as f:
#     f.write('\n'.join(data))
# try:
#     str.encode(asd)
# except Exception as e:
#     with open('info_error', 'a') as f:
#         f.write(f'analyze_disease_info:http://3g.jib.xywy.com/il_sii_8.html\n{e}')
import re
str = """
	"id": "14",
	"pinyin": "waike",
	"name": "外科",
	"second": [{
		"id": "15",
		"pinyin": "ganranke",
		"name": "感染科"
	}, {
		"id": "16",
		"pinyin": "puwaike",
		"name": "普外科"
	}, {
		"id": "17",
		"pinyin": "guwaike",
		"name": "骨外科"
	}, {
		"id": "18",
		"pinyin": "shenjingwaike",
		"name": "神经外科"
	}, {
		"id": "19",
		"pinyin": "xinxiongwaike",
		"name": "心胸外科"
	}, {
		"id": "20",
		"pinyin": "gandanwaike",
		"name": "肝胆外科"
	}, {
		"id": "21",
		"pinyin": "miniaowaike",
		"name": "泌尿外科"
	}, {
		"id": "22",
		"pinyin": "shaoshangke",
		"name": "烧伤科"
	}, {
		"id": "23",
		"pinyin": "gangchangke",
		"name": "肛肠科"
	}, {
		"id": "79",
		"pinyin": "qiguanyizhi",
		"name": "器官移植"
	}, {
		"id": "80",
		"pinyin": "zhengxingmeirongke",
		"name": "整形美容科"
	}]
}, {
	"id": "25",
	"pinyin": "fuchanke",
	"name": "妇产科",
	"second": [{
		"id": "26",
		"pinyin": "fuke",
		"name": "妇科"
	}, {
		"id": "27",
		"pinyin": "chanke",
		"name": "产科"
	}]
}, {
	"id": "29",
	"pinyin": "chuanranke",
	"name": "传染科",
	"second": []
}, {
	"id": "32",
	"pinyin": "shengzhijiankang",
	"name": "生殖健康",
	"second": [{
		"id": "35",
		"pinyin": "buyunbuyu",
		"name": "不孕不育"
	}]
}, {
	"id": "36",
	"pinyin": "nanke",
	"name": "男科",
	"second": []
}, {
	"id": "39",
	"pinyin": "pifuxingbingke",
	"name": "皮肤性病科",
	"second": [{
		"id": "40",
		"pinyin": "pifuke",
		"name": "皮肤科"
	}, {
		"id": "41",
		"pinyin": "xingbingke",
		"name": "性病科"
	}]
}, {
	"id": "42",
	"pinyin": "zhongyike",
	"name": "中医科",
	"second": [{
		"id": "43",
		"pinyin": "zhongyizonghe",
		"name": "中医综合"
	}, {
		"id": "44",
		"pinyin": "zhenjiuke",
		"name": "针灸科"
	}, {
		"id": "45",
		"pinyin": "zhongyigushangke",
		"name": "中医骨伤科"
	}, {
		"id": "81",
		"pinyin": "zhongyililiaoke",
		"name": "中医理疗科"
	}, {
		"id": "82",
		"pinyin": "zhongyimeirong",
		"name": "中医美容"
	}]
}, {
	"id": "50",
	"pinyin": "wuguanke",
	"name": "五官科",
	"second": [{
		"id": "51",
		"pinyin": "yanke",
		"name": "眼科"
	}, {
		"id": "52",
		"pinyin": "kouqiangke",
		"name": "口腔科"
	}, {
		"id": "53",
		"pinyin": "erbihouke",
		"name": "耳鼻喉科"
	}]
}, {
	"id": "54",
	"pinyin": "jingshenke",
	"name": "精神科",
	"second": []
}, {
	"id": "56",
	"pinyin": "xinlike",
	"name": "心理科",
	"second": []
}, {
	"id": "58",
	"pinyin": "erke",
	"name": "儿科",
	"second": [{
		"id": "59",
		"pinyin": "erkezonghe",
		"name": "儿科综合"
	}, {
		"id": "83",
		"pinyin": "xiaoerwaike",
		"name": "小儿外科"
	}, {
		"id": "84",
		"pinyin": "xiaoerneike",
		"name": "小儿内科"
	}]
}, {
	"id": "60",
	"pinyin": "yingyangke",
	"name": "营养科",
	"second": []
}, {
	"id": "70",
	"pinyin": "zhongliuke",
	"name": "肿瘤科",
	"second": [{
		"id": "85",
		"pinyin": "zhongliuneike",
		"name": "肿瘤内科"
	}, {
		"id": "86",
		"pinyin": "zhongliuwaike",
		"name": "肿瘤外科"
	}]
}, {
	"id": "77",
	"pinyin": "qitakeshi",
	"name": "其他科室",
	"second": [{
		"id": "28",
		"pinyin": "yaopinke",
		"name": "药品科"
	}, {
		"id": "30",
		"pinyin": "chaoshengke",
		"name": "超声科"
	}, {
		"id": "31",
		"pinyin": "zhongzhengjianhu",
		"name": "重症监护"
	}, {
		"id": "62",
		"pinyin": "fuzhujiancha",
		"name": "辅助检查"
	}, {
		"id": "63",
		"pinyin": "jianfei",
		"name": "减肥"
	}, {
		"id": "64",
		"pinyin": "kangfuke",
		"name": "康复科"
	}, {
		"id": "65",
		"pinyin": "liliaoke",
		"name": "理疗科"
	}, {
		"id": "66",
		"pinyin": "qitazonghe",
		"name": "其他综合"
	}, {
		"id": "67",
		"pinyin": "huli",
		"name": "护理"
	}, {
		"id": "68",
		"pinyin": "shenghuochangshi",
		"name": "生活常识"
	}, {
		"id": "69",
		"pinyin": "baojianyangsheng",
		"name": "保健养生"
	}, {
		"id": "46",
		"pinyin": "zhongxiyijieheke",
		"name": "中西医结合科"
	}]
}, {
	"id": "87",
	"pinyin": "jizhenke",
	"name": "急诊科",
	"second": []
}, {
	"id": "88",
	"pinyin": "ganbing",
	"name": "肝病","""
print(re.findall(r'"name": "(.+?)"', str))
